<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

/**
 * Class InterPushUserInfo
 *
 * @package App\Model
 * @mixin \Eloquent
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo query()
 * @property int $id
 * @property int|null $user_id 用户id
 * @property string $weixin_img 微信二维码
 * @property string $me_province 帮我推_省
 * @property int $me_province_id 帮我推_省id
 * @property string $he_province 帮他推_省
 * @property int $he_province_id 帮他推_省id
 * @property int $interpush_type 推广类型1个人网页，2文章
 * @property int $interpush_article 默认推广的个人网页
 * @property int $match_num 被匹配的次数
 * @property string|null $match_time 被匹配的时间
 * @property int $is_enabled 是否启用，2不启用和1启用
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property string|null $deleted_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereHeProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereHeProvinceId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereInterpushArticle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereInterpushType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereIsEnabled($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereMatchNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereMatchTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereMeProvince($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereMeProvinceId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\InterPushUserInfo whereWeixinImg($value)
 */
class InterPushUserInfo extends Model
{
    protected $table = 'interpush_user_info';
    protected $fillable = ['user_id', 'weixin_img', 'me_province', 'me_province_id', 'he_province', 'he_province_id', 'interpush_type', 'interpush_article', 'is_enabled'];

    public static function getUserWeiXinImg($user_id)
    {
        $res =  InterPushUserInfo::where('user_id', $user_id)->first();
        return $res['weixin_img'];
    }
}
